﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraReports.UI;

namespace IT_Pro.Forms
{
    public partial class frmInDanhMucCongViec : DevExpress.XtraEditors.XtraForm
    {
        public frmInDanhMucCongViec()
        {
            InitializeComponent();
        }

        private void frmInDanhMucCongViec_Load(object sender, EventArgs e)
        {
            cboLoaiYC.Properties.DataSource = Class.CV_GhiNhanYeuCau.LoadLoaiYeuCau();
            cboLoaiYC.Properties.DisplayMember = "TenLoai";
            cboLoaiYC.Properties.ValueMember = "IDLYC";
            cboLoaiYC.EditValue = "0";
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (cboLoaiYC.EditValue.ToString() != "0")
            {
                DataTable dt = Class.Print_InDanhMucCongViec.CV_GhiNhanYeuCauIT_GetByLoaiYeuCau(int.Parse(cboLoaiYC.EditValue.ToString()));

                Reports.R_DanhMucCongViec rp = new Reports.R_DanhMucCongViec();
                rp.DataSource = dt;
                rp.ShowPreview();
            }
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}